package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.service.IServeProviderService;
import com.jzo2o.customer.service.IWorkerCertificationService;
import com.jzo2o.mvc.model.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 86188
 */

@RestController("workerServeCertificationAndAuditrController")
@RequestMapping("/workerr/worker-certification-audit")
@Api(tags = "服务端 - 服务人员认证和审核相关接口")
public class ServeCertificationAndAuditrController {

    @Resource
    private IServeProviderService serveProviderService;
    @Resource
    private IWorkerCertificationService workerCertificationService ;

    @PostMapping
    @ApiOperation("提交认证申请")
    public Result<Void> workerCertificationAuditAddReq(@RequestBody WorkerCertificationAuditAddReqDTO workerCertificationAuditAddReqDTO) {
        workerCertificationService.workerCertificationAuditAdd(workerCertificationAuditAddReqDTO);
        return Result.ok();
    }

    @GetMapping("/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public Result<String>checkRejectReason() {
        String rejectReason = workerCertificationService.checkRejectReason();
        return Result.ok(rejectReason);
    }
}
